﻿<phone:PhoneApplicationPage
    x:Class="runtohealth.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps"
    xmlns:util="clr-namespace:Util"
    xmlns:facebookControls="clr-namespace:Facebook.Client.Controls;assembly=Facebook.Client"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot">

        <!-- LOCALIZATION NOTE:
            To localize the displayed strings copy their values to appropriately named
            keys in the app's neutral language resource file (AppResources.resx) then
            replace the hard-coded text value between the attributes' quotation marks
            with the binding clause whose path points to that string name.

            For example:

                Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}"

            This binding points to the template's string resource named "ApplicationTitle".

            Adding supported languages in the Project Properties tab will create a
            new resx file per language that can carry the translated values of your
            UI strings. The binding in these examples will cause the value of the
            attributes to be drawn from the .resx file that matches the
            CurrentUICulture of the app at run time.
         -->

        <!--Pivot Control-->
        <phone:Pivot Title="Run to health" Background="#FF202D36" FontFamily="Simplified Arabic Fixed" Foreground="#FF80C3E3">
            <!--Pivot item one-->
            <phone:PivotItem Header="Let's run" FontSize="20" Background="#FF202D36" FontFamily="Simplified Arabic Fixed">
                <!--Double line list with text wrapping-->
                <Grid x:Name="ContentPanel" Margin="0,-39,0,0">

                    <!-- the map -->
                    <maps:Map x:Name="Map"
					PedestrianFeaturesEnabled="True"
					LandmarksEnabled="True"
					Pitch="55"
					ZoomLevel="18" IsEnabled="False" Opacity="0.9" Margin="0,10,0,0" Foreground="#7F80C3E3"/>

                    <!-- run statistics -->
                    <Grid Background="#7F202D36" Margin="20,0,20,20" 
					VerticalAlignment="Bottom" Height="181" Opacity="0.8">
                        <Grid Margin="20"
						util:GridUtils.RowDefinitions="40, 40, Auto"
						util:GridUtils.ColumnDefinitions="*, *, *, *">

                            <!-- distance -->
                            <TextBlock Text="Distance:" FontFamily="Simplified Arabic" FontSize="24" Foreground="#FF80C3E3"/>
                            <TextBlock Text="0 km" Grid.Column="1" x:Name="distanceLabel"
							HorizontalAlignment="Center" FontFamily="Simplified Arabic" FontSize="24" Foreground="#FF80C3E3"/>

                            <!-- time -->
                            <TextBlock Text="Time:" Grid.Column="2" FontFamily="Simplified Arabic" FontSize="24" Foreground="#FF80C3E3"/>
                            <TextBlock Text="00:00:00" Grid.Column="3" x:Name="timeLabel"
							HorizontalAlignment="Center" FontFamily="Simplified Arabic" FontSize="24" Foreground="#FF80C3E3"/>

                            <!-- calories -->
                            <TextBlock Text="Calories:" Grid.Row="1" FontFamily="Simplified Arabic" FontSize="24" Foreground="#FF80C3E3"/>
                            <TextBlock Text="0" Grid.Column="1" x:Name="caloriesLabel"
							HorizontalAlignment="Center" Grid.Row="1" FontFamily="Simplified Arabic" FontSize="24" Foreground="#FF80C3E3"/>

                            <!-- pace -->
                            <TextBlock Text="Pace:" Grid.Column="2" Grid.Row="1" FontFamily="Simplified Arabic" FontSize="24" Foreground="#FF80C3E3"/>
                            <TextBlock Text="00:00" Grid.Column="3" x:Name="paceLabel"
							HorizontalAlignment="Center" Grid.Row="1" FontFamily="Simplified Arabic" FontSize="24" Foreground="#FF80C3E3"/>

                            <Button Content="Start"
							Grid.Row="2" Grid.ColumnSpan="4"
							Click="StartButton_Click"
							x:Name="StartButton" FontFamily="Simplified Arabic Fixed" FontSize="26.667" Background="#CC202D36" Foreground="#FF80C3E3" BorderBrush="#CC202D36"/>
                        </Grid>
                    </Grid>
                </Grid>
            </phone:PivotItem>

            <!--Pivot item two-->
            <phone:PivotItem Header="My History" Margin="0,28,0,0" Background="#7F202D36">

                <!--ContentPanel - place additional content here.-->
                <Grid x:Name="ContentPanel2" Grid.Row="1" Margin="10,0,12,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <!-- Bind the list box to the observable collection. -->
                    <ListBox x:Name="toDoItemsListBox" ItemsSource="{Binding ToDoItems}" 
                     Grid.Row="1" Margin="0,0,0,33" Foreground="#FF80C3E3">
                        <ListBox.ItemTemplate>
                            <DataTemplate>

                                <Grid HorizontalAlignment="Stretch" Width="470">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock
                                Text="{Binding ItemName}"
                                FontSize="{StaticResource PhoneFontSizeMedium}"
                                Grid.Column="0"
                                VerticalAlignment="Center" Width="Auto" TextAlignment="Left"/>
                                    <Button
                                Grid.Column="1"
                                x:Name="ShareTaskButton"
                                BorderThickness="0"                                
                                Click="shareTaskButton_Click" Width="Auto" HorizontalContentAlignment="Left">
                                        <Image Source="/Assets/Facebook.png"/>
                                    </Button>
                                    <Button
                                Grid.Column="2"
                                x:Name="deleteTaskButton"
                                BorderThickness="0"                                
                                Click="deleteTaskButton_Click" HorizontalContentAlignment="Left">
                                        <Image Source="/Assets/Garbage-Closed.png"/>
                                    </Button>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>

                    <Grid Grid.Row="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <facebookControls:LoginButton 
                    x:Name="loginButton" 
                    Grid.Column="1"
                    HorizontalAlignment="Right" 
                    ApplicationId="533898643348953" Visibility="Collapsed" />
                    </Grid>
                </Grid>

                <!--Double line list no text wrapping-->

            </phone:PivotItem>
        </phone:Pivot>

        <!--Uncomment to see an alignment grid to help ensure your controls are
            aligned on common boundaries.  The image has a top margin of -32px to
            account for the System Tray. Set this to 0 (or remove the margin altogether)
            if the System Tray is hidden.

            Before shipping remove this XAML and the image itself.-->
        <!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" IsHitTestVisible="False" />-->
    </Grid>

</phone:PhoneApplicationPage>